package com.rd.student.jiaji.class3.caiyuxin;


import java.util.Scanner;

public class jinzita {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        //输入层数
        System.out.println("请输入金字塔层数");
        int num = scanner.nextInt();

        //执行层数
        for (int i = 0; i < num; i++) {

            //打印空格
            for (int j = num * 2; j > i * 2 + 2; j--) {
                System.out.print(" ");
            }
            int o = i + 1;
            for (int q = 0; q < i + 1; q++) {

                if (o == 1) {
                    System.out.print(o);
                } else {
                    System.out.print(o + " ");
                    o--;
                }


            }
            int p = 2;
            for (int q = 0; q < i; q++) {
                System.out.print(" " + p);
                p++;
            }

            System.out.println();


        }


    }
}
